<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        宠物美容
        <small>Control panel</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 控制台</a></li>
        <li class="active">宠物美容</li>
      </ol>
    </section>



    <!-- Main content -->
    <section class="content">

      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">Advertising  Table</h3>

              <div class="box-tools">
                <button type="button" class="btn btn-info pull-right" data-toggle="modal" data-target="#myModal">
                  添加
                </button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
              <form action="{:url('admin/cosmetology/delall')}" method="post">
              <table class="table table-hover">
                <tbody><tr>
                  <th class="text-center" width="100"><input type="checkbox" value="" id="checkall" class=""> 全选</th>
                  <th>ID</th>
                  <th>图片</th>
                  <th>简介</th>
                  <th style="width: 20%">操作</th>
                </tr>
                <?php foreach($cosmetology as $v): ?>
                <tr>
                  <td class="text-center"><input type="checkbox" value="<?php echo $v['co_id']; ?>" name="idarr[]" class="cbox"></td>
                  <td><?php echo $v['co_id'] ?></td>
                  <td><img src="<?php echo thumb($v['co_img'], 250, 200); ?>" alt=""></td>
                  <td><?php echo $v['co_content'] ?></td>


                  <td>
                    <a href="{:url('admin/cosmetology/edit',['id' => $v['co_id'] ])}"><button type="button" class="btn btn-sm btn-primary glyphicon glyphicon-pencil">  修改</button></a>
                    <a href="{:url('admin/cosmetology/del',['id' => $v['co_id'] ])}"><button type="button" class="btn btn-sm btn-danger glyphicon glyphicon-trash">  删除</button></a>
                  </td>
                </tr>
                <?php endforeach; ?>


                </tbody></table>
                <div class="pull-left" style="margin: 20px;">
                  <button type="submit" class="btn btn-default btn-gradient pull-right delall"><span class="glyphicon glyphicon-trash"></span></button>
                </div>
              </form>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
      </div>


    </section>
    <!-- /.content -->
  </div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">添加广告图</h4>
      </div>
      <form method="post" action="{:url('admin/cosmetology/add')}" id="myform" enctype="multipart/form-data">
        <div class="modal-body">

          <div class="row text-center">
            <div class="col-lg-12" id="preview">
              <img id="imghead" border="0" src="__ADMINMY__/photo_icon.png" width="150" height="150" onclick="$('#previewImg').click();">
              <label for="" style="margin-right: 20px;">上传图片</label>
            </div>
            <input type="file" name="image" onchange="previewImage(this,500,250)" style="display: none;" id="previewImg">
          </div>
          <div class="row text-center" style="margin-top: 20px;">
            <div class="col-lg-12">

              <div class="input-group">
                <span class="input-group-addon" id="basic-addon2">简介</span>
                <input type="text" name="co_content" class="form-control"  aria-describedby="basic-addon2">

              </div>
            </div>
          </div>



        </div>
        <div class="modal-footer">
          <button type="submit" class="btn  btn-info"  >保存</button>
          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
          <!--<button type="button" class="btn btn-primary">Save changes</button>-->
        </div>
      </form>
    </div>
  </div>
</div>
